package com.cn.jinl.controller;


import com.cn.jinl.api.IActionPermissionService;
import com.cn.jinl.domain.ActionPermission;
import com.cn.jinl.utils.JsonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/permission")
public class ActionPermissionController {

    @Autowired
    private IActionPermissionService actionPermissionService;

    @ResponseBody
    @RequestMapping("/queryActionPermission/{frontToken}")
    public JsonResponse<List<ActionPermission>> queryActionPermission(@PathVariable(value = "frontToken",required = true) String frontToken) throws Exception {
        JsonResponse<List<ActionPermission>> response = new JsonResponse<List<ActionPermission>>();
        List<ActionPermission> list = actionPermissionService.queryActionPermission();
        response.setResult(list);
        response.setSuccess(true);
        return response;
    }

}
